<!DOCTYPE html>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/vhuichen.ico">
  <link rel="icon" type="image/png" sizes="32x32" href="/vhuichen.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/vhuichen.ico">
  <link rel="mask-icon" href="/vhuichen.ico" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha256-AbA177XfpSnFEvgpYu1jMygiLabzPCJCRIBtR5jGc0k=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"vhuichen.github.io","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.13.0","exturl":false,"sidebar":{"position":"left","display":"display","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}}</script><script src="/js/config.js"></script>

    <meta name="description" content="前言在Mac下写Demo，一般会把Demo放在GitHub上，但有些项目不允许公开，也不想每次写完一部分都手动本地保存，那么有一个较好的方法就是在搭建本地SVN服务器。 搭建SVN服务器Mac自带SVN服务，只需要手动开启即可使用。步骤大致可分为两步，先创建一个创库，再启动SVN服务器注意：仓库目录是相对于服务器目录而言的，当我们连接一个SVN服务器的时候，仓库的目录是相对于服务器的 查看SVN版">
<meta property="og:type" content="article">
<meta property="og:title" content="iOS基础之搭建SVN服务器">
<meta property="og:url" content="https://vhuichen.github.io/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8B%E6%90%AD%E5%BB%BASVN%E6%9C%8D%E5%8A%A1%E5%99%A8/index.html">
<meta property="og:site_name" content="vhuichen">
<meta property="og:description" content="前言在Mac下写Demo，一般会把Demo放在GitHub上，但有些项目不允许公开，也不想每次写完一部分都手动本地保存，那么有一个较好的方法就是在搭建本地SVN服务器。 搭建SVN服务器Mac自带SVN服务，只需要手动开启即可使用。步骤大致可分为两步，先创建一个创库，再启动SVN服务器注意：仓库目录是相对于服务器目录而言的，当我们连接一个SVN服务器的时候，仓库的目录是相对于服务器的 查看SVN版">
<meta property="og:locale">
<meta property="og:image" content="https://github.com/vhuichen/image/blob/master/image/svnauthz.png?raw=true">
<meta property="og:image" content="https://github.com/vhuichen/image/blob/master/image/Cornerstone-FileRepository.png?raw=true">
<meta property="og:image" content="https://github.com/vhuichen/image/blob/master/image/SVNServeConnoct.png?raw=true">
<meta property="og:image" content="https://github.com/vhuichen/image/blob/master/image/SVNAddFile.png?raw=true">
<meta property="og:image" content="https://github.com/vhuichen/image/blob/master/image/Cornerstone-AddFile.png?raw=true">
<meta property="article:published_time" content="2016-10-17T16:15:53.000Z">
<meta property="article:modified_time" content="2020-05-02T16:38:37.789Z">
<meta property="article:author" content="vhuichen">
<meta property="article:tag" content="SVN">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://github.com/vhuichen/image/blob/master/image/svnauthz.png?raw=true">


<link rel="canonical" href="https://vhuichen.github.io/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8B%E6%90%AD%E5%BB%BASVN%E6%9C%8D%E5%8A%A1%E5%99%A8/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-Hans","comments":true,"permalink":"https://vhuichen.github.io/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8B%E6%90%AD%E5%BB%BASVN%E6%9C%8D%E5%8A%A1%E5%99%A8/","path":"2016/10/2016/10/iOS基础之搭建SVN服务器/","title":"iOS基础之搭建SVN服务器"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>iOS基础之搭建SVN服务器 | vhuichen</title>
  






  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">vhuichen</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">记录、分享</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section">Home</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section">Archives</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section">About</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%89%8D%E8%A8%80"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%90%AD%E5%BB%BASVN%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="nav-number">2.</span> <span class="nav-text">搭建SVN服务器</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9F%A5%E7%9C%8BSVN%E7%89%88%E6%9C%AC"><span class="nav-number">2.1.</span> <span class="nav-text">查看SVN版本</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93"><span class="nav-number">2.2.</span> <span class="nav-text">创建仓库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E4%BB%93%E5%BA%93"><span class="nav-number">2.3.</span> <span class="nav-text">配置仓库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E7%99%BB%E5%BD%95%E8%B4%A6%E5%8F%B7%E5%92%8C%E5%AF%86%E7%A0%81"><span class="nav-number">2.4.</span> <span class="nav-text">配置登录账号和密码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E7%94%A8%E6%88%B7%E7%BB%84%E5%92%8C%E6%9D%83%E9%99%90"><span class="nav-number">2.5.</span> <span class="nav-text">配置用户组和权限</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%90%AF%E5%8A%A8SVN%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="nav-number">2.6.</span> <span class="nav-text">启动SVN服务器</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%85%8D%E7%BD%AECornerstone"><span class="nav-number">3.</span> <span class="nav-text">配置Cornerstone</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%B9%E6%B3%95%E4%B8%80%EF%BC%9A"><span class="nav-number">3.0.1.</span> <span class="nav-text">方法一：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%B9%E6%B3%95%E4%BA%8C%EF%BC%9A"><span class="nav-number">3.0.2.</span> <span class="nav-text">方法二：</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%94%B9%E8%BF%9B"><span class="nav-number">4.</span> <span class="nav-text">改进</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="vhuichen"
      src="/images/vhuichen.jpg">
  <p class="site-author-name" itemprop="name">vhuichen</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">78</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">86</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-Hans">
    <link itemprop="mainEntityOfPage" href="https://vhuichen.github.io/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8B%E6%90%AD%E5%BB%BASVN%E6%9C%8D%E5%8A%A1%E5%99%A8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/vhuichen.jpg">
      <meta itemprop="name" content="vhuichen">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="vhuichen">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="iOS基础之搭建SVN服务器 | vhuichen">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          iOS基础之搭建SVN服务器
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2016-10-18 00:15:53" itemprop="dateCreated datePublished" datetime="2016-10-18T00:15:53+08:00">2016-10-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2020-05-03 00:38:37" itemprop="dateModified" datetime="2020-05-03T00:38:37+08:00">2020-05-03</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/iOS%E5%9F%BA%E7%A1%80/" itemprop="url" rel="index"><span itemprop="name">iOS基础</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>在Mac下写Demo，一般会把Demo放在GitHub上，但有些项目不允许公开，也不想每次写完一部分都手动本地保存，那么有一个较好的方法就是在搭建本地SVN服务器。</p>
<h1 id="搭建SVN服务器"><a href="#搭建SVN服务器" class="headerlink" title="搭建SVN服务器"></a>搭建SVN服务器</h1><p>Mac自带SVN服务，只需要手动开启即可使用。<br>步骤大致可分为两步，先创建一个创库，再启动SVN服务器<br><strong>注意：仓库目录是相对于服务器目录而言的，当我们连接一个SVN服务器的时候，仓库的目录是相对于服务器的</strong></p>
<h2 id="查看SVN版本"><a href="#查看SVN版本" class="headerlink" title="查看SVN版本"></a>查看SVN版本</h2><blockquote>
<p>chenhuideMBP:&#x2F; chenhui$ <strong>svnserve –version</strong><br>svnserve, version 1.9.4 (r1740329)<br>   compiled Aug 24 2016, 21:45:29 on x86_64-apple-darwin15.0.0</p>
</blockquote>
<blockquote>
<p>Copyright (C) 2016 The Apache Software Foundation.<br>This software consists of contributions made by many people;<br>see the NOTICE file for more information.<br>Subversion is open source software, see <a target="_blank" rel="noopener" href="http://subversion.apache.org/">http://subversion.apache.org/</a></p>
</blockquote>
<blockquote>
<p>The following repository back-end (FS) modules are available:</p>
<ul>
<li>fs_fs : Module for working with a plain file (FSFS) repository.</li>
<li>fs_x : Module for working with an experimental (FSX) repository.</li>
</ul>
</blockquote>
<h2 id="创建仓库"><a href="#创建仓库" class="headerlink" title="创建仓库"></a>创建仓库</h2><blockquote>
<p>svnadmin create &#x2F;SVN&#x2F;Local&#x2F;   </p>
</blockquote>
<p>一条语句简单粗暴搞定<br>其中<code>/SVN/Local/</code>为仓库的地址，如果没有权限则需要使用sudo<br>创建成功后，ls查看该目录会生成一下文件</p>
<blockquote>
<p>README.txt<br>db<br>hooks<br>conf<br>format<br>locks   </p>
</blockquote>
<h2 id="配置仓库"><a href="#配置仓库" class="headerlink" title="配置仓库"></a>配置仓库</h2><p>打开conf目录下的svnserve.conf文件，找到下面内容    </p>
<blockquote>
<p><code># anon-access = read</code><br><code># auth-access = write</code><br><code># password-db = passwd</code><br><code># authz-db = authz</code><br>去掉所有的#号，并把anon-access的值改为none，不允许匿名访问<br>anon-access &#x3D; <strong>none</strong><br>auth-access &#x3D; write<br>password-db &#x3D; passwd<br>authz-db &#x3D; authz   </p>
</blockquote>
<h2 id="配置登录账号和密码"><a href="#配置登录账号和密码" class="headerlink" title="配置登录账号和密码"></a>配置登录账号和密码</h2><p>打开conf目录下的passwd文件，并添加**<code>vhuichen = 123456</code>**</p>
<blockquote>
<p><code>[users]</code><br><code># harry = harryssecret</code>		<br><code># sally = sallyssecret</code>		<br><strong><code>vhuichen = 123456</code></strong><br>标示登录账号<code>vhuichen</code>和密码<code>123456</code>   </p>
</blockquote>
<h2 id="配置用户组和权限"><a href="#配置用户组和权限" class="headerlink" title="配置用户组和权限"></a>配置用户组和权限</h2><p>打开conf目录下的authz文件<br><img src="https://github.com/vhuichen/image/blob/master/image/svnauthz.png?raw=true" alt="Alt text"><br>设置组名，已经组用户。<br>[&#x2F;] 表示在根目录下 对应的组名拥有的权限   </p>
<h2 id="启动SVN服务器"><a href="#启动SVN服务器" class="headerlink" title="启动SVN服务器"></a>启动SVN服务器</h2><blockquote>
<p>svnserve -d -r &#x2F;SVN<br><code>注意：是/SVN而不是/SVN/Local</code><br><strong>一台Mac理论上只能启动一个SVN服务器，所以当远程需要连接的时候只要知道这台电脑的IP地址就可以知道这台电脑启动的SVN服务器的地址，而仓库的地址都是相对于这个服务器而言的，所以在填写仓库地址的时候只需要填写相对于服务器的地址就行了。</strong></p>
</blockquote>
<h1 id="配置Cornerstone"><a href="#配置Cornerstone" class="headerlink" title="配置Cornerstone"></a>配置Cornerstone</h1><blockquote>
<p>添加仓库</p>
</blockquote>
<h3 id="方法一："><a href="#方法一：" class="headerlink" title="方法一："></a>方法一：</h3><p><img src="https://github.com/vhuichen/image/blob/master/image/Cornerstone-FileRepository.png?raw=true" alt="Alt text">   </p>
<h3 id="方法二："><a href="#方法二：" class="headerlink" title="方法二："></a>方法二：</h3><p><img src="https://github.com/vhuichen/image/blob/master/image/SVNServeConnoct.png?raw=true" alt="Alt text"></p>
<p><strong>如果仓库在本地的话也可以使用<code>127.0.0.1</code>作为本机IP地址</strong></p>
<blockquote>
<p>添加成功后，右键添加项目<br><img src="https://github.com/vhuichen/image/blob/master/image/SVNAddFile.png?raw=true" alt="Alt text"><br><img src="https://github.com/vhuichen/image/blob/master/image/Cornerstone-AddFile.png?raw=true" alt="Alt text">   </p>
</blockquote>
<blockquote>
<p>指定需要上传的文件夹，点击Import后，添加需要上传的项目上传。</p>
</blockquote>
<h1 id="改进"><a href="#改进" class="headerlink" title="改进"></a>改进</h1><p>这里只创建了一个仓库，并且在一个仓库里管理多个项目。这样做好处是简单，但也会有一些问题，比如SVN只有一个版本号，修改任何一个项目都会增加版本号。<br>还有一种方法是为<strong>每一个项目创建一个独立的仓库</strong></p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/SVN/" rel="tag"># SVN</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2016/10/2016/10/Markdown%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95/" rel="prev" title="Markdown基础语法">
                  <i class="fa fa-chevron-left"></i> Markdown基础语法
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2016/10/2016/10/iOS%E5%9F%BA%E7%A1%80%E4%B9%8BUIImage%E4%B8%A4%E7%A7%8D%E5%8A%A0%E8%BD%BD%E6%96%B9%E5%BC%8F%E7%9A%84%E5%8C%BA%E5%88%AB/" rel="next" title="iOS基础之UIImage两种加载方式的区别">
                  iOS基础之UIImage两种加载方式的区别 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 2015 – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">vhuichen</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a>
  </div>

    </div>
  </footer>

  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  





  





</body>
</html>
